package demo3;
import java.util.HashMap;
import java.util.Map;

public class MapLookupAndUpdate {
    public static void main(String[] args) {
        Map<String, Integer> studentScores = new HashMap<>();
        studentScores.put("Alice", 80);
        studentScores.put("Bob", 90);
        String targetStudent = "Alice";
        if (studentScores.containsKey(targetStudent)) {
            int newScore = studentScores.get(targetStudent) + 10;
            studentScores.put(targetStudent, newScore);
        }
        System.out.println("更新后的学生成绩: " + studentScores);
    }
}